Conditions | 1 |
Paths | 1 |
Total Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | 'use strict' |
||
16 | before(() => { |
||
17 | // we want to have logger.test() without flooding the console with other levels' messages |
||
18 | winston.setLevels({ |
||
19 | debug: 5, |
||
20 | info: 4, |
||
21 | warn: 3, |
||
22 | error: 2, |
||
23 | critical: 1, |
||
24 | test: 0 |
||
25 | }) |
||
26 | winston.addColors({ |
||
27 | debug: 'green', |
||
28 | info: 'cyan', |
||
29 | warn: 'yellow', |
||
30 | error: 'red', |
||
31 | critical: 'red', |
||
32 | test: 'blue' |
||
33 | }) |
||
34 | winston.remove(winston.transports.Console) |
||
35 | winston.add(winston.transports.Console, { level: 'test', colorize: true }) |
||
36 | winston.add(winston.transports.File, { name: 'test', filename: 'log/test.log' }) |
||
37 | |||
38 | // prepares a clean bank |
||
39 | mongoose.connect('mongodb://localhost/accounts', (err) => { |
||
40 | if (err) { |
||
41 | throw err |
||
42 | } |
||
43 | }) |
||
44 | }) |
||
45 | |||
57 |